
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet"
			type="text/css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
		<base target="_self"/>
	</head>
	<body>
		<html:form styleId="yfProjectForm"
			action="listYfProject.do?method=getYfProjectPartialList">
			<input type="hidden" id="totalPage" value="${totalPage}" />
			<input type="hidden" id="type" name="type" value="${yfProjectForm.type}" /> 
			<input type="hidden" id="projectManager" name="projectManager" value="${yfProjectForm.projectManager}" />
			<c:if test="${yfProjectForm.type!=1}">
			   <input type ="hidden" name="org" id="org" value="${loginUser.oid}"/>
			</c:if>
			<c:if test="${yfProjectForm.type==1}">
			   <input type ="hidden" name="org" id="org"/>
			</c:if>
			<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margtb5">
				<tr>
					<td align="left" class="padl5 lan12">
						<img src="<%=path%>/images/img-11.gif" width="12" height="12"></img>
						待选择项目列表
					</td>
				</tr>
			</table>
				<table cellspacing="3" cellpadding="0" width="98%" align="center"
				border="0" class="kuang2 margtb5 hei12">
				<tr>
				    <td width="10%" align="right">
						项目编号：
					</td>
					<td width="15%">
						<html:text property="projectNo" />
					</td>
					<td width="10%" align="right">
						项目名称：
					</td>
					<td width="15%">
						<html:text property="projectName" />
					</td>
					<td width="12%" align="right">
						项目类型：
					</td>
					<td width="15%">
						<ssh:select propertyName="projectType" pid="PROJECT_TYPE"
										type="1" defaultName="${yfProjectForm.projectType}" />
					</td>
					</tr>
					<tr>
					<td width="10%" align="right">
						项目机构：
					</td>
					<td width="15%">
				        <ssh:select propertyName="projectOrg" firstShow="Y" dataSource="collection" selectList="${orgSelect}"  type="1" defaultName="${yfProjectForm.projectOrg}"/> 
					</td>
						
										<td width="10%" align="right">
						发起年份：
					</td>
					<td width="15%">
					    <html:select property="initiateYear" style="width:100px">
					        <html:option value="0">--请选择--</html:option>
	                      	 <c:forEach var="i" begin="2010" end="2020" step="1">
	                      	       
	                      	 		<html:option value="${i}">${i}</html:option>
                             </c:forEach>
	                    </html:select>
					 
					</td>
					<td width="12%">
						<input class="buttonbg" id="but_query" type="button"
							value="查询"
							name="but_query" onClick="query();" />
					</td>
				</tr>
				
			</table>
			
			
			<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margb5">
			
				<tr>
					<td>
						<fmt:bundle
							basename="com.application.yfproject.struts.ApplicationResources_yfproject">
							<display:table name="yfProjectList" class="simple" id="yfProjectTab"
								pagesize="15" partialList="true" style="width:100%;"
								defaultorder="descending" size="resultSize"
								requestURI="popuSelectProjectList.do?method=popuSelectProjectList">
								<display:column   style="width:5%; text-align:center;"
									title="选择">
    <input type="hidden" id="${yfProjectTab.id}projectName" name="${yfProjectTab.id}projectName" value="${yfProjectTab.projectName}"/>
	<input type="hidden" name="${yfProjectTab.id}projectNo"  id="${yfProjectTab.id}projectNo" value="${yfProjectTab.projectNo}"/>		
	<input type="hidden" name="${yfProjectTab.id}projectOrg" id="${yfProjectTab.id}projectOrg" value="${yfProjectTab.projectOrg}"/>
	<input type="hidden" name="${yfProjectTab.id}initiateYear" id="${yfProjectTab.id}initiateYear" value="${yfProjectTab.initiateYear}"/>			
	<input type="hidden" name="${yfProjectTab.id}projectType" id="${yfProjectTab.id}projectType" value="${yfProjectTab.projectType}"/>	
		<input type="hidden" name="${yfProjectTab.id}projectManager" id="${yfProjectTab.id}projectManager" value="${yfProjectTab.projectManager}"/>	
		<input type="hidden" name="${yfProjectTab.id}rname" id="${yfProjectTab.id}rname" value="${yfProjectTab.rname}"/>					
					<input type="checkbox" name='selectId' id="selectId" onclick="chooseProject('${yfProjectTab.id}');"	 />
								</display:column>
				                <display:column property="projectNo" style="width:10%; text-align:center;"
									titleKey="com.application.yfproject.entity.yfproject.listpage.projectNo"
									sortable="false"/>
								<display:column style="width:30%; text-align:center;"
									titleKey="com.application.yfproject.entity.yfproject.listpage.projectName"
									sortable="false">
                                  <a onclick="viewProject('${yfProjectTab.id}');" href="#" >${yfProjectTab.projectName}</a> 
                                 </display:column>
								<display:column property="projectType" style="width:10%; text-align:center;"
									titleKey="com.application.yfproject.entity.yfproject.listpage.projectType"
									sortable="false" decorator="com.manager.commons.DictCodeColumnDecorator" dictCode="PROJECT_TYPE" />
								<display:column property="projectOrgName" style="width:10%; text-align:center;"
									titleKey="com.application.yfproject.entity.yfproject.listpage.projectOrg"
									sortable="false" />
		                        <display:column property="rname" style="width:10%; text-align:center;"
									title="项目经理"
									sortable="false"/>
								<display:column property="initiatePerson" style="width:10%; text-align:center;"
									titleKey="com.application.yfproject.entity.yfproject.listpage.initiatePerson"
									sortable="false"/>
								<display:column property="initiateYear" style="width:10%; text-align:center;"
									titleKey="com.application.yfproject.entity.yfproject.listpage.initiateYear"
									sortable="false"/>
							</display:table>
						</fmt:bundle>
					</td>
				</tr>
			</table>

		</html:form>
	</body>
</html>
<script>
function query(){
	document.forms[0].action="popuSelectProjectList.do?method=popuSelectProjectList&queryType=${yfProjectForm.queryType}";
	document.forms[0].submit();
}
function validateSelect(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	count++;
		}
	}
    return count;
}
//查看
function view(){
	var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	    alert("一次只能查看一条记录！");
		return;
	}else{
		document.forms[0].action="viewYfProject.do?method=viewYfProject";
	    document.forms[0].submit();
	}
}

function viewProject(id){
   document.forms[0].action="viewYfProject.do?method=viewYfProject&id=" + id;
   document.forms[0].submit();
}
this.returnValue = new Array();
function chooseProject(id){
    var projectName = id+'projectName';
    var projectNo = id+'projectNo';
    var projectOrg = id+'projectOrg';
    var initiateYear = id+'initiateYear';
    var projectType = id+'projectType';
    var projectManager = id+'projectManager';
     var rname = id+'rname';
    this.returnValue["projectName"]= $(projectName).value;
    this.returnValue["projectNo"]= $(projectNo).value;
    this.returnValue["projectOrg"]= $(projectOrg).value;
    this.returnValue["initiateYear"]= $(initiateYear).value;
    this.returnValue["projectType"]= $(projectType).value;
    this.returnValue["projectManager"]= $(projectManager).value;
     this.returnValue["rname"]= $(rname).value;
    window.close();
}
</script>
